import MySQLdb
import Joomla

joomla = Joomla.Joomla()

db_user = joomla.getConfig('user')
db_password = joomla.getConfig('password')
db_host = joomla.getConfig('host')
db_name = joomla.getConfig('db') 

name = 'test'
table = 'jos_modules'

conn = MySQLdb.connect(passwd=db_password, user=db_user, host=db_host, db=db_name)

cur = conn.cursor()
cur.execute("DESCRIBE " + table)
for row in  cur.fetchall():
    print row[0]